@extends('admin.layout.main')

@section('content')
    <div class="breadcrumbs ace-save-state" id="breadcrumbs">
        <ul class="breadcrumb">
            <li>
                <i class="ace-icon fa fa-home home-icon"></i>
                <a href="#">首页</a>
            </li>
            <li class="active"><a href="{{ url('admin/currency_list') }}">币种管理</a></li>
            <li class="active"><a href="#">编辑货币</a></li>
        </ul><!-- /.breadcrumb -->

    </div>

    <div class="row">
        <div class="col-xs-12">
            <!-- PAGE CONTENT BEGINS -->
            <form class="form-horizontal" role="form" action="/admin/currency_add" method="post" enctype="multipart/form-data"> {{csrf_field()}}
                <div class="form-group">

                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-1">*货币图片 </label>

                    <div class="col-sm-9">
                        <img src="{{$infos->logo}}" width="10%" />
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-2">*logo </label>

                    <div class="col-sm-9">
                        <input type="file" name="logo" accept="image/*"/>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-1">*货币名称 </label>

                    <div class="col-sm-9">
                        <input type="text" id="form-field-1" name="name" value="{{$infos->name}}" placeholder="货币名称" class="col-xs-10 col-sm-5" />
                        <input type="hidden" name="id" value="{{$infos->id}}"/>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-1-1">*英文标识 </label>

                    <div class="col-sm-9">
                        <input type="text" id="form-field-1-1" name="name_en" value="{{$infos->name_en}}" placeholder="英文标识" class="col-xs-10 col-sm-5" />
                    </div>
                </div>

                <div class="space-4"></div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-2">*显示排序 </label>

                    <div class="col-sm-9">
                        <input type="text"  name="orderby" value="{{$infos->orderby}}" placeholder="在前端显示的顺序，数值越小，显示越靠前" class="col-xs-10 col-sm-5" />
                    </div>
                </div>

                <div class="space-4"></div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-2"> *最大单次提币额度 </label>

                    <div class="col-sm-9">
                        <input type="text"  name="max_quota" value="{{$infos->max_quota}}" placeholder="最大单次提币额度" class="col-xs-10 col-sm-5" />
                    </div>
                </div>

                <div class="space-4"></div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-2"> *发行总量 </label>

                    <div class="col-sm-9">
                        <input type="text"  name="total" placeholder="发行总量" value="{{$infos->total}}" class="col-xs-10 col-sm-5" />
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-2">*买卖手续费(%)</label>

                    <div class="col-sm-9">
                        <input type="text"  name="fee" value="{{$infos->fee}}" placeholder="买卖手续费" class="col-xs-10 col-sm-5" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-2">*充币手续费(%) </label>

                    <div class="col-sm-9">
                        <input type="text"  name="into_fee" required value="{{$infos->into_fee}}" placeholder="充币手续费" class="col-xs-10 col-sm-5" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-2">*提币手续费(%) </label>

                    <div class="col-sm-9">
                        <input type="text"  name="out_fee" required value="{{$infos->out_fee}}" placeholder="提币手续费" class="col-xs-10 col-sm-5" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-2">*充币最小值(请输入整数) </label>

                    <div class="col-sm-9">
                        <input type="text"  name="into_value" required value="{{$infos->into_value}}" placeholder="充币最小值" class="col-xs-10 col-sm-5" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-2">*提币最小值(请输入整数) </label>

                    <div class="col-sm-9">
                        <input type="text"  name="out_value" required value="{{$infos->out_value}}" placeholder="提币最小值" class="col-xs-10 col-sm-5" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-2">*官方初定价 </label>

                    <div class="col-sm-9">
                        <input type="text"  name="official_price" value="{{$infos->official_price}}" placeholder="官方初定价" class="col-xs-10 col-sm-5" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-2">*限制位数 </label>

                    <div class="col-sm-9">
                        <input type="text"  name="unit" value="{{$infos->unit}}" placeholder="限制位数" class="col-xs-10 col-sm-5" />
                    </div>
                </div>
                {{--<div class="form-group">--}}
                    {{--<label class="col-sm-3 control-label no-padding-right" for="form-field-2">*连接地址 </label>--}}

                    {{--<div class="col-sm-9">--}}
                        {{--<input type="text"  name="url" value="{{$infos->url}}" placeholder="连接地址" class="col-xs-10 col-sm-5" />--}}
                    {{--</div>--}}
                {{--</div>--}}
                {{--<div class="form-group">--}}
                    {{--<label class="col-sm-3 control-label no-padding-right" for="form-field-2">*用户名 </label>--}}

                    {{--<div class="col-sm-9">--}}
                        {{--<input type="text"  name="username" value="{{$infos->username}}" placeholder="用户名" class="col-xs-10 col-sm-5" />--}}
                    {{--</div>--}}
                {{--</div>--}}
                {{--<div class="form-group">--}}
                    {{--<label class="col-sm-3 control-label no-padding-right" for="form-field-2">*密码 </label>--}}

                    {{--<div class="col-sm-9">--}}
                        {{--<input type="text"  name="password" value="{{$infos->password}}" placeholder="密码" class="col-xs-10 col-sm-5" />--}}
                    {{--</div>--}}
                {{--</div>--}}
                {{--<div class="form-group">--}}
                    {{--<label class="col-sm-3 control-label no-padding-right" for="form-field-2">*端口号 </label>--}}

                    {{--<div class="col-sm-9">--}}
                        {{--<input type="text"  name="prot" value="{{$infos->prot}}" placeholder="端口号" class="col-xs-10 col-sm-5" />--}}
                    {{--</div>--}}
                {{--</div>--}}
                {{--<div class="form-group">--}}
                    {{--<label class="col-sm-3 control-label no-padding-right" for="form-field-2">*钱包钥匙 </label>--}}

                    {{--<div class="col-sm-9">--}}
                        {{--<input type="text"  name="wallet_key" value="{{$infos->wallet_key}}" placeholder="秘钥" class="col-xs-10 col-sm-5" />--}}
                    {{--</div>--}}
                {{--</div>--}}
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-2">*上线开关 </label>
                    <div class="col-sm-9">
                        <input  type="radio" name="online_switch" id="online_switch" @if($infos->online_switch==0)checked="true"@endif value="0">关闭上线 &nbsp;<input type="radio" name="online_switch" id="online_switch" value="1" @if($infos->online_switch==1)checked="true"@endif>开启上线<br>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-2">*交易开关 </label>
                    <div class="col-sm-9">
                        <input  type="radio" name="pay_switch" id="pay_switch" value="0" @if($infos->pay_switch==0)checked="true"@endif}>关闭上线 &nbsp;<input type="radio" name="pay_switch" id="pay_switch" value="1" @if($infos->pay_switch==1)checked="true"@endif>开启上线<br>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-2">*买入币种 </label>
                    <div class="col-sm-9">
                        <input  type="radio" name="buy_switch" id="buy_switch" value="0" @if($infos->buy_switch==0)checked="true"@endif>关闭上线 &nbsp;<input type="radio" name="buy_switch" id="buy_switch" value="1" @if($infos->buy_switch==1)checked="true"@endif>开启上线<br>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label no-padding-right" for="form-field-2">*买入币种 </label>
                    <div class="col-sm-9">
                        <input  type="radio" name="is_standard" id="is_standard" value="0" @if($infos->is_standard==0)checked="true"@endif>普通 &nbsp;
                        <input type="radio" name="is_standard" id="is_standard" value="1" @if($infos->is_standard==1)checked="true"@endif>本位币 &nbsp;
                        <input type="radio" name="is_standard" id="is_standard" value="2" @if($infos->is_standard==2)checked="true"@endif>平台币 &nbsp;
                    </div>
                </div>




                {{--<div class="form-group">--}}
                    {{--<label class="col-sm-3 control-label no-padding-right" for="form-field-2">*货币详情连接 </label>--}}

                    {{--<div class="col-sm-9">--}}
                        {{--<input type="text"  name="info_url" value="{{$infos->info_url}}" placeholder="货币详情连接" class="col-xs-10 col-sm-5" />--}}
                    {{--</div>--}}
                {{--</div>--}}
                <div class="clearfix form-actions">
                    <div class="col-md-offset-3 col-md-9">
                        {{--<input class="btn btn-info" type="submit">--}}
                        {{--<button class="btn btn-info" type="button" onclick="on_add()">--}}
                            <button class="btn btn-info" type="submit" >
                            <i class="ace-icon fa fa-check bigger-110"></i>
                            提交
                        </button>

                        &nbsp; &nbsp; &nbsp;
                        {{--<button class="btn" type="reset">--}}
                            {{--<i class="ace-icon fa fa-undo bigger-110"></i>--}}
                            {{--返回--}}
                        {{--</button>--}}
                        <a href="javascript:history.go(-1);" class="btn">返回</a>

                    </div>
                </div>
            </form>
        </div>
    </div>
    </div><!-- /.main-content -->
    <script>
        function on_add() {
            $.ajax({
                type : "POST",
                url:'/admin/currency_add',
                data : $('form').serialize(),
                success: function(res){
                    // console.log(res);
                        if(res.status == 1){
                            layer.msg('修改成功',{icon:1})
                            location.href= '/admin/currency_list'
                        }else{
                            layer.msg(res.msg, {icon: 2});
                        }
                }
            });
        }
    </script>
@endsection
